package com.ruoyi.project.infobaseproject.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.project.infobaseproject.domain.InfoBaseProjectTargetStaging;
import com.ruoyi.project.infobaseproject.mapper.InfoBaseProjectTargetStagingMapper;
import com.ruoyi.project.infoprojecttarget.domain.InfoProjectTarget;
import com.ruoyi.project.infoprojecttarget.mapper.InfoProjectTargetMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.infobaseproject.mapper.InfoProjectTargetAdjustMapper;
import com.ruoyi.project.infobaseproject.domain.InfoProjectTargetAdjust;
import com.ruoyi.project.infobaseproject.service.IInfoProjectTargetAdjustService;

import javax.annotation.Resource;

/**
 * 项目及目标调整申请Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-04-19
 */
@Service
public class InfoProjectTargetAdjustServiceImpl implements IInfoProjectTargetAdjustService 
{
    @Autowired
    private InfoProjectTargetAdjustMapper infoProjectTargetAdjustMapper;

    @Resource
    private InfoBaseProjectTargetStagingMapper infoBaseProjectTargetStagingMapper;

    @Resource
    private InfoProjectTargetMapper infoProjectTargetMapper;

    /**
     * 查询项目及目标调整申请
     * 
     * @param id 项目及目标调整申请主键
     * @return 项目及目标调整申请
     */
    @Override
    public InfoProjectTargetAdjust selectInfoProjectTargetAdjustById(Long id)
    {
        return infoProjectTargetAdjustMapper.selectInfoProjectTargetAdjustById(id);
    }

    /**
     * 查询项目及目标调整申请列表
     * 
     * @param infoProjectTargetAdjust 项目及目标调整申请
     * @return 项目及目标调整申请
     */
    @Override
    public List<InfoProjectTargetAdjust> selectInfoProjectTargetAdjustList(InfoProjectTargetAdjust infoProjectTargetAdjust)
    {
        List<InfoProjectTargetAdjust> infoProjectTargetAdjusts = infoProjectTargetAdjustMapper.selectInfoProjectTargetAdjustList(infoProjectTargetAdjust);
        return infoProjectTargetAdjusts;
    }

    /**
     * 新增项目及目标调整申请
     * 
     * @param infoProjectTargetAdjust 项目及目标调整申请
     * @return 结果
     */
    @Override
    public int insertInfoProjectTargetAdjust(InfoProjectTargetAdjust infoProjectTargetAdjust)
    {
        infoProjectTargetAdjust.setCreateTime(DateUtils.getNowDate());
        return infoProjectTargetAdjustMapper.insertInfoProjectTargetAdjust(infoProjectTargetAdjust);
    }

    /**
     * 修改项目及目标调整申请
     * 
     * @param infoProjectTargetAdjust 项目及目标调整申请
     * @return 结果
     */
    @Override
    public int updateInfoProjectTargetAdjust(InfoProjectTargetAdjust infoProjectTargetAdjust)
    {
        return infoProjectTargetAdjustMapper.updateInfoProjectTargetAdjust(infoProjectTargetAdjust);
    }

    /**
     * 批量删除项目及目标调整申请
     * 
     * @param ids 需要删除的项目及目标调整申请主键
     * @return 结果
     */
    @Override
    public int deleteInfoProjectTargetAdjustByIds(Long[] ids)
    {
        return infoProjectTargetAdjustMapper.deleteInfoProjectTargetAdjustByIds(ids);
    }

    /**
     * 删除项目及目标调整申请信息
     * 
     * @param id 项目及目标调整申请主键
     * @return 结果
     */
    @Override
    public int deleteInfoProjectTargetAdjustById(Long id)
    {
        return infoProjectTargetAdjustMapper.deleteInfoProjectTargetAdjustById(id);
    }

    @Override
    public InfoProjectTargetAdjust selectInfoProjectTargetAdjustByProjectId(Long id) {


        return infoProjectTargetAdjustMapper.selectInfoProjectTargetAdjustByProjectId(id);
    }
}
